package com.gdth.bank.widget;

import com.gdth.bank.R;
import com.gdth.bank.widget.BankMenuPopupWindow.onPopupMenuItemClickListener;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class NotificationMenuWindow extends MenuPopupWindow implements OnClickListener{
	private Button menu1;
	private Button menu2;
	private Button menu3;
	private Button menu4;
	private Button menu5;
	/**
	* 设置自定义的popupmenu布局
	*/
	public NotificationMenuWindow(Context context, int width, int height) {
		super(LayoutInflater.from(context).inflate(R.layout.popup_notification_menu, null), width, height);
	}


	@Override
	public void initViews() {
		// TODO Auto-generated method stub
		menu1 = (Button) findViewById(R.id.menu1);
		menu2 = (Button) findViewById(R.id.menu2);
		menu3 = (Button) findViewById(R.id.menu3);
		menu4 = (Button) findViewById(R.id.menu4);
		menu5 = (Button) findViewById(R.id.menu5);
	}

	@Override
	public void initEvents() {
		menu1.setOnClickListener(this);
		menu2.setOnClickListener(this);
		menu3.setOnClickListener(this);
		menu4.setOnClickListener(this);
		menu5.setOnClickListener(this);
	}

	@Override
	public void init() {
		
		
	}
	private onNotificationMenuItemClickListener mOnPopupMenuItemClickListener;

	public void setOnPopupMenuItemClickListener(onNotificationMenuItemClickListener listener) {
		mOnPopupMenuItemClickListener = listener;
	}

	public interface onNotificationMenuItemClickListener {
		void onRearchAll();
		
		void onRearchRead();
		
		void onRearchNoRead();
		
		void onRearchType();
		
		void onRearchDel();
	}

	@Override
	public void onClick(View v) {
		switch(v.getId()) {
		case R.id.menu1:
			if(null !=mOnPopupMenuItemClickListener)
				mOnPopupMenuItemClickListener.onRearchAll();
			break;
		case R.id.menu2:
			if(null !=mOnPopupMenuItemClickListener)
				mOnPopupMenuItemClickListener.onRearchNoRead();
				
			break;
		case R.id.menu3:
			if(null !=mOnPopupMenuItemClickListener)
				mOnPopupMenuItemClickListener.onRearchRead();
			break;
		case R.id.menu4:
			if(null !=mOnPopupMenuItemClickListener)
				mOnPopupMenuItemClickListener.onRearchType();
			break;
		case R.id.menu5:
			if(null !=mOnPopupMenuItemClickListener)
				mOnPopupMenuItemClickListener.onRearchDel();
			break;
		}
		
	}
	
}
